const express = require('express');
const router = express.Router();//Router:路径
const checkUser = require("../middlewares/checkUser");
const signinjian = require('../middlewares/signinjian');
const generateToken = require('../middlewares/generateToken');

router.post("/", [signinjian, checkUser, generateToken], function (req, res) {
  // 中间件判断账号是否存在和登录需求
  return res.status(200).send({ good: "登录成功!", token: req.token });
});

// 导出api(路径)
module.exports = router;